<?php
require_once('defs.php');

header('Content-disposition: attachment; filename=database.sql');
header('Content-type: application/octet-stream');
$handle = popen('sqlite3 '.DBASEFILE.' .dump', 'r');

while($str = fgets($handle)) {
    print($str);
}

pclose($handle);
?>
